package me.firstapp.service.system;

import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.system.Operator;

public interface OperatorService {

	/**
	 * 通过id查询操作员
	 * 
	 * @param id
	 * @param apiClientId
	 * @return
	 */
	Operator findOperatorById(Long id, Long apiClientId);

	/**
	 * 通过账户名查询操作员
	 * 
	 * @param name
	 * @param apiClientId
	 * @return
	 */
	Operator findOperatorByName(String name, Long apiClientId);

	/**
	 * 通过邮箱查询操作员
	 * 
	 * @param email
	 * @param apiClientId
	 * @return
	 */
	Operator findOperatorByEmail(String email, Long apiClientId);

	/**
	 * 新增操作员
	 * 
	 * @param email
	 * @param password
	 * @param name
	 * @param apiClientId
	 * @return
	 */
	Operator addOperator(String email, String password, String name, Long apiClientId);

	/**
	 * 操作员登录验证
	 * 
	 * @param name
	 * @param password
	 * @param ip
	 * @param apiClientId
	 * @return
	 */
	Operator executeLogin(String name, String password, String ip, Long apiClientId);

	/**
	 * 分页查询操作员
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param apiClientId
	 * @return
	 */
	Page<Operator> findOperatorPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Long apiClientId);

	/**
	 * 修改操作员密码
	 * 
	 * @param id
	 * @param oldPassword
	 * @param newPassword
	 * @param apiClientId
	 * @return
	 */
	Operator executeAlterPassword(Long id, String oldPassword, String newPassword, Long apiClientId);

	/**
	 * 更新操作员状态
	 * 
	 * @param id
	 * @param status
	 * @param apiClientId
	 * @return
	 */
	Operator updateStatus(Long id, Integer status, Long apiClientId);
}
